package m.jclecai.com.data;

import m.jclecai.com.utils.ABPreferenceUtils;


/**
 * 用户信息
 */
public class LecaiData {
    /**
     * 编号
     *
     * @mbg.generated
     */
    private int status;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    private static final long serialVersionUID = 1L;

    private static final String KEY_STATUS = "status";//

    private static volatile LecaiData instance = null;

    private LecaiData() {
        loadUserInfo();
    }

    public static LecaiData getInstance() {
        if (instance == null) {
            synchronized (LecaiData.class) {
                if (instance == null) {
                    instance = new LecaiData();
                }
            }
        }

        return instance;
    }

    /**
     * 读取
     */
    private void loadUserInfo() {
        setStatus(ABPreferenceUtils.getIntParam(KEY_STATUS));

    }


    /**
     * 保存
     */
    public void saveUserInfo() {
        ABPreferenceUtils.saveParam(KEY_STATUS, getStatus());


    }

    /**
     * 清空
     */
    public void clearUserInfo() {
        setStatus(0);
        saveUserInfo();
    }




}
